<?php
ob_start();
session_start();
	include ("../BusinessLogicTier/DanhMucSPBUS.php");
	include ("../BusinessLogicTier/SanPhamBUS.php");
	require_once '../DataAccessTier/DBConnection.php'; 
	include ("../BusinessLogicTier/TinRaoVatBUS.php");
	require_once '../BusinessLogicTier/ThongTinNguoiDungBUS.php';
	require_once '../BusinessLogicTier/TinhBUS.php';
	include ("../BusinessLogicTier/VungBUS.php");
	include ("../BusinessLogicTier/BinhLuanBUS.php");
	include ("../BusinessLogicTier/NguoiDungBUS.php");
	include ("../BusinessLogicTier/LoaiTinRaoVatBUS.php");
header('Content-Type: text/html; charset=UTF-8');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/sanpham.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>rao vặt</title>
<!-- InstanceEndEditable -->
<link rel="stylesheet" type="text/css" href="css/timkiem.css"/>
<link rel="stylesheet" type="text/css" href="css/chitietraotin.css"/>
<link rel="stylesheet" type="text/css" href="css/top.css"/>
<link rel="stylesheet" type="text/css" href="css/header.css"/>
<link rel="stylesheet" type="text/css" href="css/menutab.css"/>
<link rel="stylesheet" type="text/css" href="css/navigation.css"/>
<link rel="stylesheet" type="text/css" href="css/leftcontent.css"/>
<link rel="stylesheet" type="text/css" href="css/centercontent.css"/>
<link rel="stylesheet" type="text/css" href="css/rightcontent.css"/>
<link rel="stylesheet" type="text/css" href="css/footer.css"/>
<link rel="stylesheet" type="text/css" href="css/sanpham.css"/>
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body>
 	<!-- InstanceBeginEditable name="EditRegion4" -->
 	
 	<!-- InstanceEndEditable -->
 	<div class="main">
 		<!--Top: Start-->   
    	<div class="top">
<?php include("top/top.php") ?>             
               
        </div>
        <!--Top: end-->
        <!-- header: start -->
        <div class="header">
<?php include("top/header.php") ?>
        </div>
        	
        <!--header:end-->
        <div class="clr"></div><!--*xóa đi phần float left, float right*/--> 
        <!--content:start-->
        
        <div class="content">
        	<!--menu tap -->
        	<div id="menu_tap">
<?php include("content/menu.php") ?>
          		 
            </div>
          	<!--navigation-->
            <div class="navigation"><span class="current"></span></div>
            <!--tim kiem -->
             <div class="timkiem_nv"> <?php include("content/timkiem.php") ?>
             </div>
             <!--left content-->
             <div class="left_content">
            
<?php include("content/left.php") ?>
            </div>
            <!--center content-->
            <div class="center_content"><!-- InstanceBeginEditable name="timkiemsanpham" -->
            <div class="center_title_bar">Thông Tin Chi Tiết</div>
            <?php 
			$stt=0;
			$MaND = $_SESSION["MaND"];
			$nguoidungBUS= new NguoiDungBUS();
			$ttnguoidungBUS = new ThongTinNguoiDungBUS();
			$cttrvBUS = new TinRaoVatBUS();
			
			//lấy thông tin người dùng qua mã người dùng
			$nguoidung = $nguoidungBUS->getNguoiDungByMaND($MaND);
			
			//lấy thông tin chi tiết người dùng thông qua mã người dũng
			$ttnguoidung = $ttnguoidungBUS->getThongTinNguoiDungByMaND($MaND);		
			$soluongsp = $cttrvBUS->getSoLuongByMaND($MaND);
			$sodong =10;
			$sotrang = ceil($soluongsp/$sodong);	
			if(!isset($_GET["p"]))
				$p=1;//p là trang
			else
				$p = $_GET["p"];						 
			$x = ($p-1)*$sodong;
			$cttrv = $cttrvBUS->getTinRaoVatByMaND($MaND,$x,$sodong);
			/*		 
			$sanphamBUS= new SanPhamBUS();
			
			$tinhBUS = new TinhBUS();
			$binhluanBUS= new BinhLuanBUS();
			
			$loaitrvBUS = new  LoaiTinRaoVatBUS();
			
			$idMaTrv= $_GET["idMatrv"];
			//lấy thông tin rao vặt thông qua mã rao vặt
			$cttrv = $cttrvBUS->getTinRaoVatByMaTRV($idMaTrv);
			
			//lấy thông tin tỉnh rao vặt thông qua mã tin rao vặt
			$tinh = $tinhBUS->getTinhByMaTRV($idMaTrv);
			//lấy thông tin bình luận thông qua mã tin rao vặt
			$binhluan= $binhluanBUS->getBinhLuanByMaTRV($idMaTrv);*/
			
			
			?>
                     <div id="tinraovat">
                        
                        <div class="thongtin_tinrao"><font size="+2">Thông Tin Cá Nhân </font><br /><br />
                            Tên Hiện Thị: <?php echo $ttnguoidung->getTenHienThi();?> </br>  
                            Địa Chỉ: <?php echo  $ttnguoidung->getDiaChi();?> </br>
                            Số ĐT: <?php echo $ttnguoidung->getSoDT();?> </br>
                                  
                            Email: <?php echo $nguoidung->getEmail();?>  <br />
                            Loại Người Dùng: Cá Nhân <br /><br />
                            <input title="Chỉnh Sửa Thông Tin Cá Nhân" type="submit" name="Cstt_Ok" value="Chỉnh sửa" class=""  />
                            
                            
                        </div>
                        <div class="hinhanh_tinrao"> Sản Phẩm Của Bạn: </br></br>
                        <?php
							if($cttrv!=NULL)
							{
								foreach($cttrv as $objcttrv)
								{?>
                             		<a href="chitiettinraovat.php?idMatrv=<?php echo $objcttrv->getMaTRV(); ?>"><?php echo $objcttrv->getTieuDe(); ?> </a>&nbsp;&nbsp;&nbsp;<a href="" onclick="<?php $cttrvBUS->delete($objcttrv->getMaTRV());?>"><img src="image/exit.png" width="20px" height="20px" title="Xóa Sản PHẩm Này"/></a><br /><br />
								 	
                             <?php }}?>
                             
                        </div>
                        <br /> <br /> <br /> <br />
                         
          	   </div>
            	 <!-- InstanceEndEditable -->
            	 </div>
             <!--right content-->
 	       <div class="right_content">               
                
</div>
            
        </div>
        <!--Content end-->
        <div class="clr"></div><!--*xóa đi phần float left, float right*/--> 
        <!--footer-->
        <div class="footer">
<?php include("footer/footer.php") ?>
        </div>
        
    </div>
    
</body>
<!-- InstanceEnd --></html>
